#pragma once
// MESSAGE SET_PID5 PACKING

#define MAVLINK_MSG_ID_SET_PID5 195

MAVPACKED(
typedef struct __mavlink_set_pid5_t {
 int16_t pid13_p; /*<  PID13_P*/
 int16_t pid13_i; /*<  PID13_I*/
 int16_t pid13_d; /*<  PID13_D*/
 int16_t pid14_p; /*<  PID14_P*/
 int16_t pid14_i; /*<  PID14_I*/
 int16_t pid14_d; /*<  PID14_D*/
 int16_t pid15_p; /*<  PID15_P*/
 int16_t pid15_i; /*<  PID15_I*/
 int16_t pid15_d; /*<  PID15_D*/
}) mavlink_set_pid5_t;

#define MAVLINK_MSG_ID_SET_PID5_LEN 18
#define MAVLINK_MSG_ID_SET_PID5_MIN_LEN 18
#define MAVLINK_MSG_ID_195_LEN 18
#define MAVLINK_MSG_ID_195_MIN_LEN 18

#define MAVLINK_MSG_ID_SET_PID5_CRC 111
#define MAVLINK_MSG_ID_195_CRC 111



#if MAVLINK_COMMAND_24BIT
#define MAVLINK_MESSAGE_INFO_SET_PID5 { \
    195, \
    "SET_PID5", \
    9, \
    {  { "pid13_p", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_set_pid5_t, pid13_p) }, \
         { "pid13_i", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_set_pid5_t, pid13_i) }, \
         { "pid13_d", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_set_pid5_t, pid13_d) }, \
         { "pid14_p", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_set_pid5_t, pid14_p) }, \
         { "pid14_i", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_set_pid5_t, pid14_i) }, \
         { "pid14_d", NULL, MAVLINK_TYPE_INT16_T, 0, 10, offsetof(mavlink_set_pid5_t, pid14_d) }, \
         { "pid15_p", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_set_pid5_t, pid15_p) }, \
         { "pid15_i", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_set_pid5_t, pid15_i) }, \
         { "pid15_d", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_set_pid5_t, pid15_d) }, \
         } \
}
#else
#define MAVLINK_MESSAGE_INFO_SET_PID5 { \
    "SET_PID5", \
    9, \
    {  { "pid13_p", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_set_pid5_t, pid13_p) }, \
         { "pid13_i", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_set_pid5_t, pid13_i) }, \
         { "pid13_d", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_set_pid5_t, pid13_d) }, \
         { "pid14_p", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_set_pid5_t, pid14_p) }, \
         { "pid14_i", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_set_pid5_t, pid14_i) }, \
         { "pid14_d", NULL, MAVLINK_TYPE_INT16_T, 0, 10, offsetof(mavlink_set_pid5_t, pid14_d) }, \
         { "pid15_p", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_set_pid5_t, pid15_p) }, \
         { "pid15_i", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_set_pid5_t, pid15_i) }, \
         { "pid15_d", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_set_pid5_t, pid15_d) }, \
         } \
}
#endif

/**
 * @brief Pack a set_pid5 message
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param msg The MAVLink message to compress the data into
 *
 * @param pid13_p  PID13_P
 * @param pid13_i  PID13_I
 * @param pid13_d  PID13_D
 * @param pid14_p  PID14_P
 * @param pid14_i  PID14_I
 * @param pid14_d  PID14_D
 * @param pid15_p  PID15_P
 * @param pid15_i  PID15_I
 * @param pid15_d  PID15_D
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t mavlink_msg_set_pid5_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
                               int16_t pid13_p, int16_t pid13_i, int16_t pid13_d, int16_t pid14_p, int16_t pid14_i, int16_t pid14_d, int16_t pid15_p, int16_t pid15_i, int16_t pid15_d)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_SET_PID5_LEN];
    _mav_put_int16_t(buf, 0, pid13_p);
    _mav_put_int16_t(buf, 2, pid13_i);
    _mav_put_int16_t(buf, 4, pid13_d);
    _mav_put_int16_t(buf, 6, pid14_p);
    _mav_put_int16_t(buf, 8, pid14_i);
    _mav_put_int16_t(buf, 10, pid14_d);
    _mav_put_int16_t(buf, 12, pid15_p);
    _mav_put_int16_t(buf, 14, pid15_i);
    _mav_put_int16_t(buf, 16, pid15_d);

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_PID5_LEN);
#else
    mavlink_set_pid5_t packet;
    packet.pid13_p = pid13_p;
    packet.pid13_i = pid13_i;
    packet.pid13_d = pid13_d;
    packet.pid14_p = pid14_p;
    packet.pid14_i = pid14_i;
    packet.pid14_d = pid14_d;
    packet.pid15_p = pid15_p;
    packet.pid15_i = pid15_i;
    packet.pid15_d = pid15_d;

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_PID5_LEN);
#endif

    msg->msgid = MAVLINK_MSG_ID_SET_PID5;
    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SET_PID5_MIN_LEN, MAVLINK_MSG_ID_SET_PID5_LEN, MAVLINK_MSG_ID_SET_PID5_CRC);
}

/**
 * @brief Pack a set_pid5 message on a channel
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param chan The MAVLink channel this message will be sent over
 * @param msg The MAVLink message to compress the data into
 * @param pid13_p  PID13_P
 * @param pid13_i  PID13_I
 * @param pid13_d  PID13_D
 * @param pid14_p  PID14_P
 * @param pid14_i  PID14_I
 * @param pid14_d  PID14_D
 * @param pid15_p  PID15_P
 * @param pid15_i  PID15_I
 * @param pid15_d  PID15_D
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t mavlink_msg_set_pid5_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
                               mavlink_message_t* msg,
                                   int16_t pid13_p,int16_t pid13_i,int16_t pid13_d,int16_t pid14_p,int16_t pid14_i,int16_t pid14_d,int16_t pid15_p,int16_t pid15_i,int16_t pid15_d)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_SET_PID5_LEN];
    _mav_put_int16_t(buf, 0, pid13_p);
    _mav_put_int16_t(buf, 2, pid13_i);
    _mav_put_int16_t(buf, 4, pid13_d);
    _mav_put_int16_t(buf, 6, pid14_p);
    _mav_put_int16_t(buf, 8, pid14_i);
    _mav_put_int16_t(buf, 10, pid14_d);
    _mav_put_int16_t(buf, 12, pid15_p);
    _mav_put_int16_t(buf, 14, pid15_i);
    _mav_put_int16_t(buf, 16, pid15_d);

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SET_PID5_LEN);
#else
    mavlink_set_pid5_t packet;
    packet.pid13_p = pid13_p;
    packet.pid13_i = pid13_i;
    packet.pid13_d = pid13_d;
    packet.pid14_p = pid14_p;
    packet.pid14_i = pid14_i;
    packet.pid14_d = pid14_d;
    packet.pid15_p = pid15_p;
    packet.pid15_i = pid15_i;
    packet.pid15_d = pid15_d;

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SET_PID5_LEN);
#endif

    msg->msgid = MAVLINK_MSG_ID_SET_PID5;
    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SET_PID5_MIN_LEN, MAVLINK_MSG_ID_SET_PID5_LEN, MAVLINK_MSG_ID_SET_PID5_CRC);
}

/**
 * @brief Encode a set_pid5 struct
 *
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param msg The MAVLink message to compress the data into
 * @param set_pid5 C-struct to read the message contents from
 */
static inline uint16_t mavlink_msg_set_pid5_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_set_pid5_t* set_pid5)
{
    return mavlink_msg_set_pid5_pack(system_id, component_id, msg, set_pid5->pid13_p, set_pid5->pid13_i, set_pid5->pid13_d, set_pid5->pid14_p, set_pid5->pid14_i, set_pid5->pid14_d, set_pid5->pid15_p, set_pid5->pid15_i, set_pid5->pid15_d);
}

/**
 * @brief Encode a set_pid5 struct on a channel
 *
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param chan The MAVLink channel this message will be sent over
 * @param msg The MAVLink message to compress the data into
 * @param set_pid5 C-struct to read the message contents from
 */
static inline uint16_t mavlink_msg_set_pid5_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_set_pid5_t* set_pid5)
{
    return mavlink_msg_set_pid5_pack_chan(system_id, component_id, chan, msg, set_pid5->pid13_p, set_pid5->pid13_i, set_pid5->pid13_d, set_pid5->pid14_p, set_pid5->pid14_i, set_pid5->pid14_d, set_pid5->pid15_p, set_pid5->pid15_i, set_pid5->pid15_d);
}

/**
 * @brief Send a set_pid5 message
 * @param chan MAVLink channel to send the message
 *
 * @param pid13_p  PID13_P
 * @param pid13_i  PID13_I
 * @param pid13_d  PID13_D
 * @param pid14_p  PID14_P
 * @param pid14_i  PID14_I
 * @param pid14_d  PID14_D
 * @param pid15_p  PID15_P
 * @param pid15_i  PID15_I
 * @param pid15_d  PID15_D
 */
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS

static inline void mavlink_msg_set_pid5_send(mavlink_channel_t chan, int16_t pid13_p, int16_t pid13_i, int16_t pid13_d, int16_t pid14_p, int16_t pid14_i, int16_t pid14_d, int16_t pid15_p, int16_t pid15_i, int16_t pid15_d)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_SET_PID5_LEN];
    _mav_put_int16_t(buf, 0, pid13_p);
    _mav_put_int16_t(buf, 2, pid13_i);
    _mav_put_int16_t(buf, 4, pid13_d);
    _mav_put_int16_t(buf, 6, pid14_p);
    _mav_put_int16_t(buf, 8, pid14_i);
    _mav_put_int16_t(buf, 10, pid14_d);
    _mav_put_int16_t(buf, 12, pid15_p);
    _mav_put_int16_t(buf, 14, pid15_i);
    _mav_put_int16_t(buf, 16, pid15_d);

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_PID5, buf, MAVLINK_MSG_ID_SET_PID5_MIN_LEN, MAVLINK_MSG_ID_SET_PID5_LEN, MAVLINK_MSG_ID_SET_PID5_CRC);
#else
    mavlink_set_pid5_t packet;
    packet.pid13_p = pid13_p;
    packet.pid13_i = pid13_i;
    packet.pid13_d = pid13_d;
    packet.pid14_p = pid14_p;
    packet.pid14_i = pid14_i;
    packet.pid14_d = pid14_d;
    packet.pid15_p = pid15_p;
    packet.pid15_i = pid15_i;
    packet.pid15_d = pid15_d;

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_PID5, (const char *)&packet, MAVLINK_MSG_ID_SET_PID5_MIN_LEN, MAVLINK_MSG_ID_SET_PID5_LEN, MAVLINK_MSG_ID_SET_PID5_CRC);
#endif
}

/**
 * @brief Send a set_pid5 message
 * @param chan MAVLink channel to send the message
 * @param struct The MAVLink struct to serialize
 */
static inline void mavlink_msg_set_pid5_send_struct(mavlink_channel_t chan, const mavlink_set_pid5_t* set_pid5)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    mavlink_msg_set_pid5_send(chan, set_pid5->pid13_p, set_pid5->pid13_i, set_pid5->pid13_d, set_pid5->pid14_p, set_pid5->pid14_i, set_pid5->pid14_d, set_pid5->pid15_p, set_pid5->pid15_i, set_pid5->pid15_d);
#else
    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_PID5, (const char *)set_pid5, MAVLINK_MSG_ID_SET_PID5_MIN_LEN, MAVLINK_MSG_ID_SET_PID5_LEN, MAVLINK_MSG_ID_SET_PID5_CRC);
#endif
}

#if MAVLINK_MSG_ID_SET_PID5_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
  This varient of _send() can be used to save stack space by re-using
  memory from the receive buffer.  The caller provides a
  mavlink_message_t which is the size of a full mavlink message. This
  is usually the receive buffer for the channel, and allows a reply to an
  incoming message with minimum stack space usage.
 */
static inline void mavlink_msg_set_pid5_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  int16_t pid13_p, int16_t pid13_i, int16_t pid13_d, int16_t pid14_p, int16_t pid14_i, int16_t pid14_d, int16_t pid15_p, int16_t pid15_i, int16_t pid15_d)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char *buf = (char *)msgbuf;
    _mav_put_int16_t(buf, 0, pid13_p);
    _mav_put_int16_t(buf, 2, pid13_i);
    _mav_put_int16_t(buf, 4, pid13_d);
    _mav_put_int16_t(buf, 6, pid14_p);
    _mav_put_int16_t(buf, 8, pid14_i);
    _mav_put_int16_t(buf, 10, pid14_d);
    _mav_put_int16_t(buf, 12, pid15_p);
    _mav_put_int16_t(buf, 14, pid15_i);
    _mav_put_int16_t(buf, 16, pid15_d);

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_PID5, buf, MAVLINK_MSG_ID_SET_PID5_MIN_LEN, MAVLINK_MSG_ID_SET_PID5_LEN, MAVLINK_MSG_ID_SET_PID5_CRC);
#else
    mavlink_set_pid5_t *packet = (mavlink_set_pid5_t *)msgbuf;
    packet->pid13_p = pid13_p;
    packet->pid13_i = pid13_i;
    packet->pid13_d = pid13_d;
    packet->pid14_p = pid14_p;
    packet->pid14_i = pid14_i;
    packet->pid14_d = pid14_d;
    packet->pid15_p = pid15_p;
    packet->pid15_i = pid15_i;
    packet->pid15_d = pid15_d;

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SET_PID5, (const char *)packet, MAVLINK_MSG_ID_SET_PID5_MIN_LEN, MAVLINK_MSG_ID_SET_PID5_LEN, MAVLINK_MSG_ID_SET_PID5_CRC);
#endif
}
#endif

#endif

// MESSAGE SET_PID5 UNPACKING


/**
 * @brief Get field pid13_p from set_pid5 message
 *
 * @return  PID13_P
 */
static inline int16_t mavlink_msg_set_pid5_get_pid13_p(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int16_t(msg,  0);
}

/**
 * @brief Get field pid13_i from set_pid5 message
 *
 * @return  PID13_I
 */
static inline int16_t mavlink_msg_set_pid5_get_pid13_i(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int16_t(msg,  2);
}

/**
 * @brief Get field pid13_d from set_pid5 message
 *
 * @return  PID13_D
 */
static inline int16_t mavlink_msg_set_pid5_get_pid13_d(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int16_t(msg,  4);
}

/**
 * @brief Get field pid14_p from set_pid5 message
 *
 * @return  PID14_P
 */
static inline int16_t mavlink_msg_set_pid5_get_pid14_p(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int16_t(msg,  6);
}

/**
 * @brief Get field pid14_i from set_pid5 message
 *
 * @return  PID14_I
 */
static inline int16_t mavlink_msg_set_pid5_get_pid14_i(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int16_t(msg,  8);
}

/**
 * @brief Get field pid14_d from set_pid5 message
 *
 * @return  PID14_D
 */
static inline int16_t mavlink_msg_set_pid5_get_pid14_d(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int16_t(msg,  10);
}

/**
 * @brief Get field pid15_p from set_pid5 message
 *
 * @return  PID15_P
 */
static inline int16_t mavlink_msg_set_pid5_get_pid15_p(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int16_t(msg,  12);
}

/**
 * @brief Get field pid15_i from set_pid5 message
 *
 * @return  PID15_I
 */
static inline int16_t mavlink_msg_set_pid5_get_pid15_i(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int16_t(msg,  14);
}

/**
 * @brief Get field pid15_d from set_pid5 message
 *
 * @return  PID15_D
 */
static inline int16_t mavlink_msg_set_pid5_get_pid15_d(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int16_t(msg,  16);
}

/**
 * @brief Decode a set_pid5 message into a struct
 *
 * @param msg The message to decode
 * @param set_pid5 C-struct to decode the message contents into
 */
static inline void mavlink_msg_set_pid5_decode(const mavlink_message_t* msg, mavlink_set_pid5_t* set_pid5)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    set_pid5->pid13_p = mavlink_msg_set_pid5_get_pid13_p(msg);
    set_pid5->pid13_i = mavlink_msg_set_pid5_get_pid13_i(msg);
    set_pid5->pid13_d = mavlink_msg_set_pid5_get_pid13_d(msg);
    set_pid5->pid14_p = mavlink_msg_set_pid5_get_pid14_p(msg);
    set_pid5->pid14_i = mavlink_msg_set_pid5_get_pid14_i(msg);
    set_pid5->pid14_d = mavlink_msg_set_pid5_get_pid14_d(msg);
    set_pid5->pid15_p = mavlink_msg_set_pid5_get_pid15_p(msg);
    set_pid5->pid15_i = mavlink_msg_set_pid5_get_pid15_i(msg);
    set_pid5->pid15_d = mavlink_msg_set_pid5_get_pid15_d(msg);
#else
        uint8_t len = msg->len < MAVLINK_MSG_ID_SET_PID5_LEN? msg->len : MAVLINK_MSG_ID_SET_PID5_LEN;
        memset(set_pid5, 0, MAVLINK_MSG_ID_SET_PID5_LEN);
    memcpy(set_pid5, _MAV_PAYLOAD(msg), len);
#endif
}
